import Vue from 'vue';
import Router from 'vue-router';

Vue.use(Router);

export default new Router({
    routes: [
        {
            path: '/',
            redirect: '/dashboard'
        },
        {
            path: '/',
            component: resolve => require(['../components/common/Home.vue'], resolve),
            meta: { title: '自述文件' },
            children:[
                {
                    path: '/dashboard',
                    component: resolve => require(['../components/page/investment.vue'], resolve),
                    meta: { title: '投资项目' }
                },
                {
                    path: '/userInfo',
                    component: resolve => require(['../components/page/userInfo.vue'], resolve),
                    meta: { title: '用户信息' }
                },
                {
                    path: '/investmentRecord',
                    component: resolve => require(['../components/page/investmentRecord.vue'], resolve),
                    meta: { title: '投资记录' }
                },
                {
                    path: '/media',
                    component: resolve => require(['../components/page/media.vue'], resolve),
                    meta: { title: '媒体报道' }
                },
            ]
        },
        {
            path: '/login',
            component: resolve => require(['../components/page/Login.vue'], resolve)
        },
    ]
})
